﻿using System;
using WiMo.Games;
using WiMo.Games.Inputs;

namespace ResolutionAwareness
{
    public class Game : IGame
    {
        public Game(IGameEngine engine)
        {
            Engine = engine;
            Engine.ContentManager.ContentLocation = "Content";
            Engine.Display.BackgroundColor = Color.Yellow;
            Engine.EnableDiagnostics = true;
            Engine.DiagnosticsFontColor = Color.Black;
        }

        public void Initialize()
        {

        }

        public void BeginRun()
        {

        }

        public void CreateMenus()
        {

        }

        public void LoadContent()
        {

        }


        IInputManager _previous;

        public void Update(GameTime gameTime)
        {
            if (Engine.InputManager.WasPressed(_previous, Keys.Return))
                Engine.Exit();

            _previous = this.Engine.InputManager;
        }

        public void Draw(GameTime gameTime)
        {
            Engine.Display.DrawText(new PointF(80, 180), "Hello World", Engine.DefaultFont, Color.Black);
        }

        public bool CanExit()
        {
            return true;
        }

        public IGameEngine Engine { get; set; }
    }
}
